﻿function PendingProjectViewModel(model) {
    var selfModel = this;

    selfModel.List = new ListViewModel();

    ko.mapping.fromJS(model, {}, selfModel.List.Items);

    selfModel.RebindList = function () {
        var method = whoever.AJAX.Method({
            data: {},
            action: "/PendingProject/RebindList"
        });

        method.success(function (List) {
            ko.mapping.fromJS(List, {}, selfModel.List.Items);
        });
    };

    selfModel.SetToOnRevision = function (selected) {
        var method = whoever.AJAX.Method({
            data: ko.toJSON(selected),
            action: "/PendingProject/SetToOnRevision"
        });

        method.success(function (result) {
            toastr.success("OK");
        });
    };

    Main.Page.Init("Info", "PendingProject");
}